14填空以数据集{4,5,6,7,10,12,18}为结点权值所构造的哈夫曼树,其带权路径长度为?ConstructaHuffmantreewiththeweights{4,5,6,7,10,12,18}.Whatistheweightedexternalpathlength?
15单选一个深度为h的满k叉树,最多有多少个结点?(独根树深度为0)Forafullk-arytreewithdepthh,howmanynodescouldithaveatmost?(thedepthofatreewithonlyonenodeis0)
A.
B.
C.
D.
16填空从空二叉树开始,严格按照二叉搜索树的插入算法(不进行旋转平衡),逐个插入关键码{15,82,10,4,55,89,29,45,54,35,25}构造出一颗二叉搜索树,对该二叉搜索树按照后序遍历得到的序列为(每两个元素之间用一个空格隔开)Givenanullbinarytree,insertkeyvalues{15,82,10,4,55,89,29,45,54,35,25}successivelyaccordingtotheinsertionalgorithmofabinarysearchtreestrictly(norotationandbalance)toconstructabinarysearchtree.Pleasewritedownthesequenceofpostorderofthisbinarysearchtree.(Thereisoneblankspacebetweentwoelements)
17单选对二叉排序树(即BST,也称“二叉搜索树”)进行什么遍历,可以得到该二叉树所有结点构成的排序序列?Fromwhichtraversalcanwegettheorderedsequenceofthenodesofabinarysearchtree?
A.前序preorder
B.后序postorder
C.按层次levelorder
D.中序inorder
18多选2-3树是一种特殊的树,它满足两个条件:(1)每个内部结点有两个或三个子结点;(2)所有的叶结点到根的路径长度相同;如果一棵2-3树有10个叶结点,那么它可能有_________个非叶结点。(多选)2-3treeisaspecialkindoftree,whichsatisfies:(1)Everyinternalnodehas2or3childrennodes.(2)Alltheleafnodeshavethesamepathlengthfromtherootnode.Ifa2-3treehas10leafnodes,thenitmayhave__________non-leafnodes.(multiplechoice)
A.8
B.7
C.5
D.6
数据结构与算法
北京大学
军职在线答案
大学网课